package vn.com.epi.re.data;

public class Article implements Comparable<Article> {
    private int id;
    private int numberOfReading;
    
    public Article() {        
    }

    public Article(int id, int numberOfReading) {
        setId(id);
        setNumberOfReading(numberOfReading);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getNumberOfReading() {
        return numberOfReading;
    }

    public void setNumberOfReading(int numberOfReading) {
        this.numberOfReading = numberOfReading;
    }

    @Override
    public int compareTo(Article other) {
        if (this.numberOfReading == other.numberOfReading)
            return 0;
        else
            return this.numberOfReading > other.numberOfReading ? -1 : 1;
    }
}
